package demo07.BatchExecution.control;

import demo07.BatchExecution.command.Command;
import demo07.BatchExecution.commandImp.HottubOffCommand;
import demo07.BatchExecution.commandImp.HottubOnCommand;
import demo07.BatchExecution.commandImp.LightOffCommand;
import demo07.BatchExecution.commandImp.LightOnCommand;
import demo07.BatchExecution.commandImp.StereoOffCommand;
import demo07.BatchExecution.commandImp.StereoOnCommand;
import demo07.BatchExecution.commandImp.TVOffCommand;
import demo07.BatchExecution.commandImp.TVOnCommand;
import demo07.BatchExecution.macroCommand.MacroCommand;
import demo07.BatchExecution.object.Hottub;
import demo07.BatchExecution.object.Light;
import demo07.BatchExecution.object.Stereo;
import demo07.BatchExecution.object.TV;

public class RemoteLoader {

	public static void main(String[] args) {

		RemoteControl remoteControl = new RemoteControl();

		Light light = new Light("客厅");
		TV tv = new TV("客厅");
		Stereo stereo = new Stereo("客厅");
		Hottub hottub = new Hottub();
 
		LightOnCommand lightOn = new LightOnCommand(light);
		StereoOnCommand stereoOn = new StereoOnCommand(stereo);
		TVOnCommand tvOn = new TVOnCommand(tv);
		HottubOnCommand hottubOn = new HottubOnCommand(hottub);
		LightOffCommand lightOff = new LightOffCommand(light);
		StereoOffCommand stereoOff = new StereoOffCommand(stereo);
		TVOffCommand tvOff = new TVOffCommand(tv);
		HottubOffCommand hottubOff = new HottubOffCommand(hottub);

		Command[] partyOn = { lightOn, stereoOn, tvOn, hottubOn};//开启命令数组
		Command[] partyOff = { lightOff, stereoOff, tvOff, hottubOff};//关闭命令数组
		//宏命令数组
		MacroCommand partyOnMacro = new MacroCommand(partyOn);
		MacroCommand partyOffMacro = new MacroCommand(partyOff);
 
		remoteControl.setCommand(0, partyOnMacro, partyOffMacro);//一键开关
  
		System.out.println(remoteControl);
		System.out.println("--- 全部开启---");
		remoteControl.onButtonWasPushed(0);
		System.out.println("--- 全部关闭---");
		remoteControl.offButtonWasPushed(0);
	}

/*------ 远程控制 -------
[位置 0] 开启类demo07.BatchExecution.macroCommand.MacroCommand   关闭类  demo07.BatchExecution.macroCommand.MacroCommand
[位置 1] 开启类demo07.BatchExecution.noCommand.NoCommand   关闭类  demo07.BatchExecution.noCommand.NoCommand
[位置 2] 开启类demo07.BatchExecution.noCommand.NoCommand   关闭类  demo07.BatchExecution.noCommand.NoCommand
[位置 3] 开启类demo07.BatchExecution.noCommand.NoCommand   关闭类  demo07.BatchExecution.noCommand.NoCommand
[位置 4] 开启类demo07.BatchExecution.noCommand.NoCommand   关闭类  demo07.BatchExecution.noCommand.NoCommand
[位置 5] 开启类demo07.BatchExecution.noCommand.NoCommand   关闭类  demo07.BatchExecution.noCommand.NoCommand
[位置 6] 开启类demo07.BatchExecution.noCommand.NoCommand   关闭类  demo07.BatchExecution.noCommand.NoCommand
[撤销：类] demo07.BatchExecution.noCommand.NoCommand

--- 全部开启---
打开灯
客厅 立体声是开着的
打开电视
频道设置为VCR。
热水浴缸加热到冒泡 88 摄氏度
热水浴缸在冒泡
--- 全部关闭---
关闭灯
客厅 立体声是关闭的
关闭电视
热水浴缸冷却到 38  摄氏度
*/
}
